0

I'm working on app that is giving SharePoint Users Groups as a result. Finally I finished almost everything - the last condition I have to complete is dynamic site address, so my app and flow could be used in more than one website.

Currently my HTTP request looks like this:

enter image description here

What should I type in Site Address section to make it dynamic?

5
  • It depends on how you want to pass the dynamic value to flow: 1. Pass value from app to flow using flow inputs 2. Use environment variables. Aug 2 at 10:36
  • Users don't have to provide any inputs (only click the button in powerapp) so I think it should be an environment variable?
    – Yarensky
    Aug 2 at 10:43
  • You can create a variable inside a power app with site URL & pass it to the flow as an input while running the flow. Aug 2 at 10:51
  • I'm not sure how to make it. Should I add another step to my flow using Initialize variable and pass it before PowerApps(V2) step in flow?
    – Yarensky
    Aug 2 at 11:17
  • Check my answer given below. hope it helps! Aug 2 at 12:19

2 Answers 2

1

You can add one more flow input in PowerApps (V2) trigger like:

enter image description here

Then use this input in HTTP request action from dynamic content:

  1. Click in Site address dropdown & any random text (example: xyz) and click on "Enter custom value":

    enter image description here

  2. Select siteAddress input from dynamic content:

    enter image description here


In Power apps change the formula where you are running the flow like:

Set(userGroupNamesString, FlowName.Run(User().Email, "https://contoso.sharepoint.com/sites/work").usergroupnames);

In 2nd parameter, pass the site address.


Update from comments:

Use formula like below:

Set(
    userGroupNames;
    GroupRetrieveByEmail.Run(User().Email; "https://contoso.sharepoint.com/sites/work").usergroupnames
);;
6
  • So my actual formula in OnSelect looks like this: i.imgur.com/Q0TY8Cp.png so after GroupRetrieveByEmail.Run(User().Email should i type siteAddress?
    – Yarensky
    Aug 2 at 12:59
  • Yes, check updated answer for formula. Aug 2 at 13:23
  • I used formula as you show above, but there is some syntax error Set(userGroupNames;GroupRetrieveByEmail.Run(User().Email); "https://contoso.sharepoint.com/sites/work").usergroupnames);; "Invalid argument amount: received 3, expected: 2"
    – Yarensky
    Aug 2 at 13:37
  • Can you use the same formula I gave (copy-paste the same)? In your above comment there is ) extra after User().Email. Also, replace the site URL as per your actual site URL. Aug 2 at 13:58
  • I already copy-paste same formula as you provide: i.imgur.com/9zgWyK4.png i add second semicolon after User().Email but after running app it now doesn't display any groups
    – Yarensky
    Aug 2 at 14:32
0

You can create a variable in your Power Automate flow and then use that variable for the site address value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.