The length function is not working correctly without using flatten

Certified Associate Developer
Here, the integrationResponse.result.body is an array of dictionaries. However, the length function returns 1 if not using flatten. Not sure why this is happening. Please share comments/reasons if any.

  Discussion posts and replies are publicly visible

Parents
  •   ,  , sorry for the delay in replying.

    Here, I am replying from my other account.

    While I was replying to your thread, my account got frozen Worried. I am getting the following error:

    "There is an issue with your user account: The allowed frequency of abusive content was exceeded (by 'Abusive User Detection by Abuse Frequency')."

    Not sure what went wrong. I just entered a URL that I was using to get a JSON reply and pasted a snapshot of JSON reply. I have not added any abusive content.

    Due to this, I am not able to participate in community activities as well Cry.

    Hopefully, the community admin will give access back to my account.

    Please let me know if anyone have any ideas to resolve this.

  • 0
    Certified Lead Developer
    in reply to Yogi Patel
    There is an issue with your user account

    This has been happening to a bunch of us intermittently.  I've alerted the community admins for you.  They're working to straighten things out as they happen (i assume the spam filters are set too strong or something.)

  • OK. Thank You!
    I appreciate your help.
  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    There is a rule set that only allows for 2 discussion posts or replies per minute. If you exceed this amount, your account will be flagged. If you have any additional questions, please let us know. This is what i got from Community when i asked about it.

  • Yes, there is limit on posting comments. However, I am getting following message:

    "There is an issue with your user account: The allowed frequency of abusive content was exceeded (by 'Abusive User Detection by Abuse Frequency')."

    Also, till account is locked. Hence, not able to post any comments. Hopefully, community admin will unlock it.

  • 0
    Certified Lead Developer
    in reply to Yogi Patel

    Hi, I am facing same issue. my local variable return list of string. count and length both return 1 

Reply Children
  • 0
    Certified Lead Developer
    in reply to sugasanr0001

    PFA snapshot.

  • 0
    Certified Lead Developer
    in reply to sugasanr0001

    this is not very meaningful without seeing your actual code, data structure, etc.

    What is the "totalCount" here actually resulting from?  How are you trying to ascertain the length/count?

  • 0
    Certified Lead Developer
    in reply to Mike Schmitt

  • 0
    Certified Lead Developer
    in reply to sugasanr0001

    your integration call is probably returning a nested list.  you didn't post the expanded version of the data structure it's returning so it's hard to know for sure.  either way, wrap "rule!ABC_getOrders()" in a "a!flatten()" call and see what happens.

  • 0
    Certified Lead Developer
    in reply to Mike Schmitt

    Thank you for your input. On the formatted result it say "list of String " but when i open the value it shows Anytype ,

    I type cast to list string and it worked. thanks.

    a!localVariables(


    local!orderIds: rule!ABC_getOrders(id: "Abc"), //integration call returns List of strings

    local!totalCount: length(cast(typeof({"asdjahsd","asdasfasd"}),local!orderIds)),

    local!totalCount)

  • 0
    Certified Lead Developer
    in reply to sugasanr0001

    Instead of using typeof() you can also directly reference a type. In your case it would be one of this.

  • 0
    Certified Lead Developer
    in reply to Stefan Helzle

    or just wrap in toUniformString()?