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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to add another att...
Power Automate
Unanswered

How to add another attribute to a value from SPO form?

(0) ShareShare
ReportReport
Posted on by 105

I have a form on SPO which has a radio button called "what sort of team" (student, staff, project). At the moment I use that to set the naming prefix we currently use but would also like it to set the template when creating the team (educationClass, educationStaff etc). Is there a way I can add another attribute to a value used in Power Automate then call it later on in the flow using expressions or something?

Like if this value is student then add "educationClass", if staff then add "educationStaff" etc


I've tried to Google what I should be using but might be using the wrong terminology (new to Power Automate)

Categories:
I have the same question (0)
  • eric-cheng Profile Picture
    5,171 on at

    Hi @f2 ,

     

    You can use variables to store a value and use it in another part the flow here.  To prefix or join together two or more  values, use the concat function here.

     

    For your purpose, select the Initialize Variable action and give it a name (so that you can refer to it later), a type (string for text) and an initial value (use the concat function here).

     

    You can also use the Set Variable action at anytime to store a new value.

     

  • f2 Profile Picture
    105 on at

    Hi @eric-cheng 

     

    Embarrassed to say I've not made any progress, could I post up a screenshot of what I have and see what you think? I've watched a few youtube videos about variables which included using compose and in their lesson/environment I did get it working but for not for my example (or I couldn't think of how to modify it and get it working for my example).

     

    1st pic is my example flow and the 2nd pic is part of the form with the "Type of Team" radio button. I was hoping when the user filled out the form and selected say "Staff" I could somehow use the compose feature to match that input to my variable and get the "educationStaff" which I could then use later on in the flow.

     

    flow_example.png

    formexample.JPG

  • eric-cheng Profile Picture
    5,171 on at

    Hi @f2 ,

     

    I created a survey with a choice question similar to yours.

     

    In the flow, add a Get response details action after your trigger.  If you save it and submit a form, the body should look similar to mine.   In this case, I am after the last field.  The name of the field for you should be slightly different

     

    ericcheng_0-1626099098815.png

     

    Add an Initialize variable action, give it a name and select String for the type.    Click on the Value text box and then Expression. 

     

    ericcheng_3-1626099361530.png

     

    Paste this in concat('education',)

     

    ericcheng_4-1626099430113.png

     

    Move your cursor in between , and ) as below and click on Dynamic content

    ericcheng_5-1626099650210.png

    Click on the field that correlates to the question.  For me it is "type of team" but yours may be named differently,

     

    ericcheng_6-1626099724026.png

    Click on OK

    ericcheng_7-1626099822935.png

     

    Save your flow, submit a new survey and go to your flow run.  Is this what you are after?

     

    ericcheng_1-1626099184093.png

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

     

  • f2 Profile Picture
    105 on at

     

    That works amazing @eric-cheng! I see how you got that to work so thanks for taking time to set all that up! However I didnt explain myself properly...my boss setup Teams to have the following prefix:

     

    Staff-TeamName

    Student-TeamName

    Project-TeamName

    Commercial-TeamName

     

    But the templates are:

    educationStaff (for Staff)

    educationClass (for Student)

    standard (for Project/Commercial)

     

    MS templates from here:

    https://docs.microsoft.com/en-us/microsoftteams/get-started-with-teams-templates

     

    So your concat example is ideal for "Staff" since the prefix and template are both "Staff" however it wont work with the others since the prefix and templates are different names (if that makes sense?).

     

    Sorry for all the hassle eric.

     

    Edit:

    I was thinking in your original post you mentioned setting up a variable, is there an expression that would take the data from the form and if it matches something in the variable then set the output matching value?

    teamtemplates.JPG

  • f2 Profile Picture
    105 on at

    If I use:

     

    if(equals(outputs('Get_response_details')?['body/r78c25ef840ae4e928175405ff8b81cd2'],string('Staff')),'educationStaff',if(equals(outputs('Get_response_details')?['body/r78c25ef840ae4e928175405ff8b81cd2'],string('Student')),'educationClass'))

     

    It works for Staff or Student, however if I follow the same formatting for Project and Commercial I get an error in Power Automate. When checking:

    https://docs.microsoft.com/en-us/power-automate/use-expressions-in-conditions

     

    Perhaps "if" can only be "yes or no" / "true or false"?

     

  • f2 Profile Picture
    105 on at

    I've think I've managed to get a workaround using "conditions", so if form question "Type of Team" equals "Staff" then go down "yes" and create the Team. If No, there is another condition with a similar setup, if "Type of Team" equals "Student" go down yes and create the Team (same for Project and Commercial). Its made the flow a bit messy but seems to work.

     

    Unless anybody has any other suggestions for a cleaner/easier way to achieve this?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 671

#3
Haque Profile Picture

Haque 551

Last 30 days Overall leaderboard