1) The flow triggers whenever a new User gets created in Dynamics 365 CE. The next action after the trigger is the 'List a row by ID'. This is what I filled in in that action:
Table: teammemberships
Filter rows: systemuserid eq @{triggerOutputs()?['body/systemuserid']}
2) Then a Apply To Each action
Select an output from the previous steps: @{outputs('ListTeams')?['body/value']}
3) Within the Apply To Each action I have a Condition action:
Left side of condition: @outputs('ListTeams')?['body/value']
Operator: is equal to
Right side of condition: G.A-Case365-All
Yes Branch:
Update row by ID:
Table name: Users
Row ID: @{triggerOutputs()?['body/systemuserid']}
Business Unit: /dlw_businessunitdemes(b708d2be-6650-ed11-bba3-000d3adf7e97)
List a row by ID:
Table name: Security Roles
Filter rows: name eq 'General' or name eq 'Test' or name eq 'Dynamics Test'