0

I want a Power Automate flow to update a column (Pickable) based on the value of another column (Location). The logic is that if the character after the second period in the Location column is a 3, the Pickable location value should be "No." Otherwise it should be "Yes." Here's my set up.

  • List Rows (Dataverse table)
  • Apply to Each (output from List Rows)
    • Update a Row (same table as List Rows / row ID is the standard Dataverse ID column)

This is the expression I want to use in the Update a Row action for the Pickable column, but it doesn't work:

if(split(item()?['Location'], '.')[2]='3','No','Yes')

Robby
  • 843
  • 3
  • 19
  • 53

1 Answers1

1

You need to use the equals expression, you can't just use the = sign within the PowerAutomate expression context.

This is untested but adapt this as need be ...

if(equals(split(string(item()?['Location']), '.')[2], '3'),'No','Yes')
Skin
  • 9,085
  • 2
  • 13
  • 29
  • I'm getting an error. I can confirm that all rows in the table do not have null values. "Unable to process template language expressions in action 'Update_a_row' inputs at line '0' and column '0': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Null'." – Robby Feb 23 '22 at 05:20
  • I updated my answer to include the `string` expression but not sure that will help. This is going away from your original question a little. Can you confirm what the contents of the `Location` property looks like? A screenshot would help. – Skin Feb 23 '22 at 06:03
  • 1
    It could be the user_friendly name is Location, but once you start writing expressions, the real name is something like cr123_location, this can be different from your name. (Assuming you use a dataverse column). – Iona Varga Feb 23 '22 at 10:52