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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / datacard default value sp
Power Apps
Unanswered

datacard default value sp

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a person type datacard in my form (in my case the datacard is called 'Privacy/ATIP Manager Approval'). My goal is to have the datacard display a default value or person's email address who is associated to that role (for an example 123@gmail.com). However, I want it to first check a SP list (named DOA). That SP list will have a column called 'Role' that will include various roles such as the Privacy/ATIP Manager, IT Director, etc. If the Privacy/ATIP Manager has delegated his role to an incumbent (meaning someone else acts in his role for a certain period of time as in between the Start and End Date) and the form is being filled in within the Start and End Date of this person acting as the Privacy/ATIP Manager, I want that person's name displayed as the 'Default' value instead of the original Privacy/ATIP Manager's name.

 

To be more specific, the important columns within my 'DOA' SP list are the Incumbent (Person), Delegate (Person), Start Date(Regular Date), End Date (Regular Date), Role (Multiple Choice), and Active Incumbent (Y/N) columns. I have attached an example along with a screenshot of what an entry would look like:

 

joshuaj_0-1687962815905.pngjoshuaj_1-1687962878030.png

 

 

With this information, would you know the code I should put in the Default part of the datacard (or it may be another area I'm not sure)? I'm still very new to Power Apps and I'm running into loads of errors with my attempts. Please let me know if there is any other information you need!

Categories:
  • v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    May I ask if your datacard called ‘Privacy/ATIP Manager Approval' is a form built with the SP list as the data source?

    We assume that your datacard exists in a form with DOA as the data source.

     

    We created the SharePoint List as you offered.

    vhanytianmsft_2-1688009044618.png

     

    Add a datacard into the Form.

    vhanytianmsft_3-1688009044621.png

     

    The Items of the Combo Box:

    [ThisItem.Delegate,ThisItem.Incumbent]

    vhanytianmsft_4-1688009044624.png

     

    The DefaultSelectedItems of the Combo Box:

    If(Int(DateDiff(Today(),ThisItem.'Start Date',TimeUnit.Days)) <= 0 && Int(DateDiff(Today(),ThisItem.'End Date',TimeUnit.Days)) >= 0,

                ThisItem.Delegate,

                ThisItem.Incumbent

            )

    vhanytianmsft_5-1688009044629.png

     

     

    We can see the Combo Box is worked from the screenshot.

     

    If we change the date.

    vhanytianmsft_6-1688009044630.png

     

    It will still worked as we expect.

    vhanytianmsft_7-1688009044632.png

     

     

    Hope this will help you.

     

    Best Regards,

    Tina

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Wow, I appreciate all this. I understand the logic you've enabled based on your code and screenshots. I realize I wasn't very clear on a few things so allow me to be a bit clearer. The DataCard 'Privacy/ATIP Manager Approval' is apart of another SP list separate from the 'DOA' SP list. Also, the purpose of the 'Active Incumbent' column is to do the date calculation within SP. It determines if Today's date is in between the Start and End Date of an entry in the DOA SP list. If it is, Active Incumbent is set to Yes. If Today's date isn't between the two dates, 'Active Incumbent' is set to No.

     

    I don't see the DefaultSelectedItems tab anywhere. Should I be looking at the DataCard itself when implementing these functions or the DataCardValue?

     

    Something I was trying to get working earlier would be something like this in terms of displaying the default value for the DataCard, I just am really struggling with the syntax and getting it to work: 

    If(

        LookUp(DOA, Role = "Privacy/ATIP Manager").'Active Incumbent' = "Y",

        LookUp(DOA, Role = "Privacy/ATIP Manager").Incumbent.Email,

        "joshua.john@gmail.com"

    )

     

    Let me know if this help cleared up anything, sorry for the miscommunication!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard