web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Set variable with a ro...
Power Automate
Unanswered

Set variable with a row id returned from List rows in a cloud flow

(0) ShareShare
ReportReport
Posted on by 31

Set variable with a row id returned from List rows in a cloud flow

I created a cloud flow that looks like the following:

gcoleman_3-1636518656121.jpeg

It’s designed to run instant on one or several Contact rows and create a Project row for each selected contact. The new Project row should have a column value for Project Type, which is a row from a third table.

  • I set the value of the string variable projectType with the result of the List rows step.
  • List rows has a filter (tamc_name eq 'RMD Support') and row count =1. It addresses the Project Types table.
  • I’m getting an error “Action 'Add_a_new_row' failed” with details “Bad Request - Error in query syntax.”
  • This error is about the Project Type value in the Add a new row in the Projects table step.

Here’s how I reference the value of projectType in the Add a new row step:

gcoleman_4-1636518807324.jpeg

Would appreciate any thoughts about what I’m doing wrong.

Am I supposed to extract a single value out of what List rows returns? (If so, how?)

Should projectType be a different datatype?

Is surrounding the variable value with <plural of table name>(<variable ref>) the correct syntax?

Should I use a better method for getting the row id for a specific Project Type?

 

Thanks.

Categories:
I have the same question (0)
  • rgriff50 Profile Picture
    31 on at

    I’m surprised and disappointed I didn’t get any replies on this. I finally made it work on my own and wanted to help somebody like me in the future, who is just starting and needs basic, simple advice, by reporting what I think I learned.

     

    The key learnings were (1) my Set variable step needed to be placed inside an Apply to each step, and (2) I also needed to pull out from the row, the guid value for the Project Type instance to be put as the value of the corresponding field on the Project record being created (added).

     

    Here’s my overall flow that’s now working:

    gcoleman_0-1636690942918.png

    Here’s the detailed view of Set variable:

    gcoleman_1-1636690982375.png

    I believe the guid value available was from one of the columns of a selected row, not from the whole row itself. While I was trying to refer to the whole record of a selected row, I kept getting syntax errors.

     

    Then, once I had a valid value in the projectType variable, and I used the proper syntax for referring to it in the Add a new row step shown here:

    gcoleman_2-1636691039967.png

    everything finally worked.

     

    A particularly valuable reference I found was an article by Linn Zaw Win on his Power Platform Notebook blog. Win explains the proper format for referencing a lookup value is <<EntitySetName>>(<<RecordGUID>>) e.g. contacts(<ContactID>). Entity Set Name is the schema name of the table with an 's' on the end.

     

    If an expert reading this can correct any errors or misunderstandings, I would be grateful. Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 265 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 203 Most Valuable Professional

#3
trice602 Profile Picture

trice602 202 Super User 2025 Season 2

Last 30 days Overall leaderboard