Skip to main content
Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
Unanswered

How to call an action/workflow?

(0) ShareShare
ReportReport
Posted on by 44

Hi all,

 

My portal is an commerce website. and i have 3 main entities in my workflow: contact,product, and order.

 

I want the workflow to create an order when someone signs into the portal.

 

Can someone give me an explanation on how to call the action/portal on my portal?

 

  • OOlashyn Profile Picture
    3,496 Most Valuable Professional on at
    Re: How to call an action/workflow?

    Hi @Verceti87 ,

    If you don't mind that user, when login will be redirected to profile page each time what you can do, is to add js to the profile page and use Web API to create your order. Using a virtual entity is a cool idea as well (kudos @chleverenz). If you are using an external login provider and doing some claims mapping (ie external id or email) what you can do is to run a sync plugin on the update operation and perform your operation there. I was using a similar approach when we needed to assign a contact record on login to a different account ( as in that case there were multiple) based on the provided claim. Similarly to @chleverenz I cannot share the code but I think I explain it in enough detail.  

  • ragavanrajan Profile Picture
    7,036 Most Valuable Professional on at
    Re: How to call an action/workflow?

    Hi @Verceti87 

     

    You can use virtual entities as @chleverenz  mentioned. Probably for more advanced scenarios.  You can try the following method with the help of power automate.  When the user login to the portal using Azure AD or local it is possible to capture the entry and associate a record to a different entity. 

     

    Here are the steps. 

     

    In Power Automate:  

     

    1. Select dataverse trigger ( Screenshot below) (When a row is added, modified or deleted). 

    2. Adding the flow steps below for your reference. (All marked boxes are important) 

     

    ragavanrajan_0-1640209152502.png

    ragavanrajan_1-1640209461568.png

     

    Basically, the idea here is to create a relationship to your product and order entity from the contact table. 

     

    In the above screenshot change, the red highlighted your product or order entity.  

     

    Note: This will work. When the user logins to the portal and when they fill the profile page and press the "update" button. 

     


    Hope it helps. 
    ------------

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

  • Verceti87 Profile Picture
    44 on at
    Re: How to call an action/workflow?

    Thanks for your response. All im trying to do is associate a single active order to the user currently logged into the portal. I will look into the virtual entities...

  • Christian Leverenz Profile Picture
    1,214 on at
    Re: How to call an action/workflow?

    Hi @Verceti87 ,

    supported calls to custom actions are a planned feature: https://docs.microsoft.com/en-us/power-platform-release-plan/2021wave2/power-apps-portals/portals-web-api-support-dataverse-custom-actions

     

    The problem is the moment, when to trigger that action. Actually you do not know, when the user signs in. There is a field called last login or something like that on the contact. This field could be used to trigger it (when it works) unfortunately you will not know, for which site the user logged in and i am afraid that this is only set (if at all) when using local accounts.

     

    What i would do is: create a lookup on the contact pointing to the order you want to create (really orders??). You could check in liquid, whether this field is filled and if not, create via the webapi a new order (or whatever) or redirect the user vbia js to a new order creation. You could also add a kind of triggerfield to the contact which is used by your workflow to trigger your action.

     

    What my colleagues and i do is using a virtaul entity ( https://docs.microsoft.com/en-us/powerapps/developer/data-platform/virtual-entities/get-started-ve ) as a custom action trigger. Its really ugly but works. When you select from that virtual entity you could pass in the contact as a parameter and this virtaul entity could read the whereclause and put the contactid to the workflow/custom action you are using and return the id of the generated order.

    Unfortunately i can not share the code as it is closed source from the company, but you get the idea. This is an adaequte replacement as long as custom actions are not working. You do not need to use virtual entities but doing so enables you to create the stuff also via liquid which brings the whole process to the backend.

     

    Hope this helps,

      Christian

     

    PS do you really want to create something after login? I mean, this could produce a lot of dead tableentries for you. Just a question.

     

    PPS may be @ragavanrajan or @OOlashyn have an idea how to trigger something upon login, they are really helpful

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 1

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 1

#3
surya narayanan Profile Picture

surya narayanan 35