cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KD203
Helper II
Helper II

Portal contact in workflow

Hello all!

I've been trying to get the portal contact which activates an entity list workflow so i can put the Full Name and job name in an email i'm sending to the primary contact of the record i started the workflow on. The workflow it self is really simple because it only sends a single email with a bunch of information about the selected record on the entity list. But it basically has no purpose if i can't get the contacts information.

Is there a way to get the contacts information that i'm not aware of?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @KD203,

You won't be able to identify this with the Run Workflow action, and would likely need to go a custom route - an idea would be to change the workflow from being On Demand to being triggered by an update to a field - like a Lookup to Contact, titled something like "Workflow Run By". Then you'd want to see if you can use JavaScript to add a custom button to your list that calls the Preview Feature API (https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-overview) to update the record with the current contact's logged in user.

This is just one option, but all of the ones I can think of will require some fairly decent dev/customization.

View solution in original post

5 REPLIES 5
OliverRodrigues
Super User II
Super User II

Hi

 

Just to confirm, you have an entity list and are triggering a workflow action via that list, right?

 

Does your records from the entity list have a lookup for the Contact? If yes that's how you get the information from the contact, in the workflow you can navigate through lookup's data

 

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Hi, @OliverRodrigues ,

Yes, i have an entity list and im triggering a workflow action through the drop down menu that appears.
The records i have in the entity list have a connection to a contact which could run this workflow, but there is another type of contacts with different roles and acceses to the records which should be able to run this workflow aswell.

The problem accurs when i want to differentiate from these two types of contacts - one is related directly with a relationship to the records and the other one can see these records, because they have a relationship to his parent account.

Hi @KD203,

You won't be able to identify this with the Run Workflow action, and would likely need to go a custom route - an idea would be to change the workflow from being On Demand to being triggered by an update to a field - like a Lookup to Contact, titled something like "Workflow Run By". Then you'd want to see if you can use JavaScript to add a custom button to your list that calls the Preview Feature API (https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-overview) to update the record with the current contact's logged in user.

This is just one option, but all of the ones I can think of will require some fairly decent dev/customization.

View solution in original post

Hi @justinburch ,

Thanks for the help, accepted your answer as the solution.

Just out of curiosity what would be the more dev/customization variants of making this functional?

Hi @KD203,

Some ideas:

  1. Setup a custom API (if wanting to wait for the Preview feature to become publicly established) using the old-school method, where you create an entity and query for it, intercept the query with a RetrieveMultiple plugin and use "filters" in the query to detail the action required - e.g. retrieve "WorkflowRunner" where new_targetId = GUID of entity, new_actionId = GUID of workflow, createdby = GUID of the contact who ran it. This injects a fake "response" (even though no record exists) of a retrieved record with the status of the actual run. This is not recommended by Microsoft (despite it being used by the product itself in the old Marketing API), but requires 1. no Azure components and 2. no Preview features
  2. Create an Azure based API using the implicit grant flow feature to call the workflow with passed in GUIDs, extracting the contact's info from the bearer token provided for authentication (https://docs.microsoft.com/en-us/powerapps/maker/portals/oauth-implicit-grant-flow)
  3. The method I suggested before, which doesn't require any C#/Azure code but still plenty of code!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,895)