Apply to each action fails

Options

My apply to each action keeps failing, after a few successful runs. I have an expression to split the incoming data, but it is not splitting.

Step that fails:

43eec406d11d97ded922e2b358d793ed-huge-im

In the flow -

a950576eae5b68227fbf3853020bd58a-huge-im

Expression - split(triggerBody()?['data']?['Solicit Codes'], ',')

I think it is missing the “item” step but everything I have tried fails.

Comments

  • @Wendy Bondeson- Hi Wendy, how are the values coming in prior to this step. Are they comma separated already or are you appending them to an array or string? I'm thinking you need to pull each one then add each one. Can you show the previous few steps?

  • @Carol Grant they are comma separated. The only previous step are HTTP Request, Validate token, current time and get a constituent.

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Wendy Bondeson
    if what you want to split is: triggerBody()?['data']?['Solicit Codes']

    and the data is like No Direct Mail,Calendar and you want to split by comma

    then split(triggerBody()?['data']?['Solicit Codes'], ‘,’) is correct and it will return an array of 2 strings: No Direct Mail and Calendar

    That array should be placed in the apply to each, which it looks like you did, however, your Create a constituent solicit code action is using triggerBody()?['data']?['Solicit Codes'] directly, which is trying to loop 2x, and both time trying to create solicit code No Direct Mail,Calendar.

    Instead, delete the dynamic content of the Solicit Codes in your Create a constituent solicit code aciton, and instead, go to expression, and type in item()

  • @Alex Wong thank you that was it!!!

Categories