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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Model Driven app. Two ...
Power Apps
Answered

Model Driven app. Two apps for the same table. Set defult value per app

(0) ShareShare
ReportReport
Posted on by 30

Hi experts. I have a Dataverse Table and two fidderent Model Driven apps that uses the table. In the table there is a Yes/No field. I would like to set  the field based on witch app the users are using. If they are using App01 the Yes/No field should be set as Yes, and if they are using App02 the Yes/No field shoud be set as No.

 

I have tried to build a Business rule, but cannot wrape my head around how the rule can determine witch app the users are using. There is no other field that has a vaule that I can relate on and set the Yes/No field. If that was the case I could have used a Business rule, bit I am not sure this is possible.

 

Has any of you tried something similar?

 

/Frank

I have the same question (0)
  • ivan_apps Profile Picture
    2,187 Moderator on at

    Are users able to run both apps? or is one app restricted by security role? 

    I don't know if you can easily determine which app you're running, but assuming each has a different user base and access to the app is granted by security role - you can use javascript to grab the user's security roles and then flip the switch from that.

    A slightly less stable solution is to parse the URL via javascript and grab the "appid".  If appid = specific app -- flip the switch.  However your app id changes when you publish to different environments so you might have to store it as an environment variable and query that first.

     

    Business rules can't be turned on "per app", they're tied to the table, so it wouldn't be possible with that.

  • venseben Profile Picture
    30 on at

    Hi @ivan_apps Yes, all users are able to run both apps. The apps share same tables but uses the data in a different context. I am more like a canvas app person, and thpought "Okay, I can do that in a canvas app, then I can do it in a Model Driven app". But no, it is not that simple. I am a non developer so this might has to be skipped on to one of our developers.

     

    It may just be Me, but I am not a fan of the Model Driven apps lack of flexibility 😞

     

    Thanks for taking your time

     

    /Frank

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @venseben,

    Model-driven apps are quite powerful once you get the hang of it and its capabilities. You can achieve that out-of-the-box but not directly by setting the app to the business rule.  Have a form per app (note in general, it is suggested to have a form per app for flexibility/future proofing/regression/etc), then have a business rule per form (one that sets the field to yes and the other two no), then associate the form only to the app it should be in. The app with automatically open the form it's mapped to and run that specific business rule, voila!

    Hope this helps...

  • venseben Profile Picture
    30 on at

    So you mean that I should have build several apps, insted of one app and several forms?

     

    /Frank

  • Verified answer
    EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    From your title and description, I thought you had two apps... Yes, you can have one app and multiple forms with a business rule per form. User can manually switch between forms and that specific business rule will apply (note the last visited form per user will be defaulted one load). If you want the form to automatically open per different user types. You'll have to apply a security role to a form, so a role per user type. More info: https://learn.microsoft.com/power-apps/maker/model-driven-apps/control-access-forms?WT.mc_id=DX-MVP-5004271#set-security-roles-for-a-form 
    Hope this clarifies

  • venseben Profile Picture
    30 on at

    You are right @EricRegnier. I have two apps and several forms on the same table. I know it is possible to switch between forms, but it could be nice to have the field that i mentioned set automatically by witch app is opened. But as far as I can see,I need to build in some Java script to get what I want.

     

    Thanks for taking your time.

     

    /Frank

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard