Skip to main content

Notifications

Community site session details

Community site session details

Session Id : kHVz9Q6r5+jq2PUzRLVday
Power Apps - Building Power Apps
Unanswered

How to select default value of dropdown based on Previous entry in Sharepoint List

Like (0) ShareShare
ReportReport
Posted on 22 Apr 2024 09:29:02 by 52

Hi guys I am new to powerapps 

      Please help me in this situation  I have a sharepoint list named EID in that choice column is there containing old and new  in powerapps i  have tax regime dropdown for that i have used this old and new values in dropdown  and in edit form it shows tax regime with dropdown of old and new values after clicking submit it goes history page showing tax regime old or new based on user selected in dropdown.    My Requirement if user select old regime in dropdown in history page also it  will shows old regime but after  if he want to add one entry in edit form it should  show old regime only  in default value of dropdown . sameway  if user select new  regime in dropdown in history page also it  will shows newregime but after  if he want to add one entry in edit form it should show  new regime in default value of dropdown . Can anyone help me in this situation.

 

 

I have used this formula in default property of dropdown but it doesnot work

 

If(IsBlank (Lookup(Eid,  EmployeeMail = Officee365Users.MyProfileV2().Mail)),

"old",  Lookup(Eid, EmployeeEmail = Office365Users.MyProfileV2().Mail))

 

 

 

Thanks and Regards

Aldous

  • Aldous345 Profile Picture
    52 on 24 Apr 2024 at 05:16:32
    Re: How to select default value of dropdown based on Previous entry in Sharepoint List

    Hi @v-mengmli-msft I have tried above formula in default selected items i have selected old regime and after submit it the old regime entry stored into sharepoint list EID but after again i create new declaration it show both old and new regime in dropdown but i want to show in old regime because i already have old regime entry in sharepoint list sameway i want to show new regime if new regime entry already in sharepoint list. still i didnt get proper output can you help me  meanwhile items property of dropdown i have this formula Choices([@EID]. 'Tax Regime')

  • v-mengmli-msft Profile Picture
    on 23 Apr 2024 at 09:00:27
    Re: How to select default value of dropdown based on Previous entry in Sharepoint List

    Hi @Aldous345 ,

     

    It is just in my previous reply, I edited it.😀

    Well, it seems that I didn't make it clear.

    If(IsEmpty(Filter(EID,'Created By'.Email=Office365Users.MyProfileV2().mail)),Filter(Choices([@EID].'Tax Regime'),Value="Old"), Last(SortByColumns(Filter(EID,'Created By'.Email=Office365Users.MyProfileV2().mail),"ID",SortOrder.Ascending)).'Tax Regime')

    vmengmlimsft_0-1713862666234.png

     

    If it shows any errors, please attach it in your next reply.

     

    Best regards,

    Rimmon

     

  • Aldous345 Profile Picture
    52 on 23 Apr 2024 at 08:29:23
    Re: How to select default value of dropdown based on Previous entry in Sharepoint List

    Hi @v-mengmli-msft  Can you Send me the new formula please

  • v-mengmli-msft Profile Picture
    on 23 Apr 2024 at 07:03:48
    Re: How to select default value of dropdown based on Previous entry in Sharepoint List

    Hi @Aldous345 ,

     

    I have just modified my formula, please try the newest.

     

    Best regards,

    Rimmon

  • Aldous345 Profile Picture
    52 on 23 Apr 2024 at 06:43:24
    Re: How to select default value of dropdown based on Previous entry in Sharepoint List

    Hi I am got this error

     

     

    dropdown error.png

     

     

    I am got this Error The function 'Filter' has some invalid arguments, Name isnot recognized 'Choices' isn't recognized, Invalid use of '.' , Name isn't valid. 'Value' isn't recognized,  Incompatible types for comparison. These types can't be compared : Error,Text  These are the errors i am facing.

  • v-mengmli-msft Profile Picture
    on 23 Apr 2024 at 05:30:33
    Re: How to select default value of dropdown based on Previous entry in Sharepoint List

    Hi @Aldous345 ,

     

    Please try "Created By" column if you don't have EmployeeEmail column.

     

    If(IsEmpty(Filter(EID,'Created By'.Email=Office365Users.MyProfileV2().mail)),Filter(Choices([@EID].'Tax Regime'),Value="Old"), Last(SortByColumns(Filter(EID,'Created By'.Email=Office365Users.MyProfileV2().mail),"ID",SortOrder.Ascending)).'Tax Regime')

     

     

    If above formula shows error, hope you will attach some screenshots about the error.

     

    Best regards,

    Rimmon

     

  • Aldous345 Profile Picture
    52 on 23 Apr 2024 at 05:23:40
    Re: How to select default value of dropdown based on Previous entry in Sharepoint List

    Hello 

         Still I am getting Error and I dont have EmployeeEmail Column can you Please help

  • v-mengmli-msft Profile Picture
    on 23 Apr 2024 at 01:26:19
    Re: How to select default value of dropdown based on Previous entry in Sharepoint List

    Hi @Aldous345 ,

     

    This is because you are using combo box but not drop down. They have some differences.

     

    I recommend you try DefaultSelectedItems property. By the way, what is type of EmployeeMail? If it is lookup column or choice column, you can try adding ".Value" after the EmployeeMail.

     

    If(IsEmpty(Filter(EID,EmployeeEMail=Office365Users.MyProfileV2().Mail)),Filter(Choices([@EID].'Tax Regime'),Value="Old"), Last(SortByColumns(Filter(EID,EmployeeEMail= Office365Users.MyProfileV2().mail),"ID",SortOrder.Ascending)).'Tax Regime')

     

     

    The above formula will populate combo box with "Old" if current user hasn't created an item. Otherwise, the 'Tax Regime' of last created item by current user will be populated.

     

     

    Best regards,

    Rimmon

  • Aldous345 Profile Picture
    52 on 22 Apr 2024 at 11:47:29
    Re: How to select default value of dropdown based on Previous entry in Sharepoint List

    Hi 

     

       Sorry I am getting Error can you please update for when new is selected in dropdown

  • Aldous345 Profile Picture
    52 on 22 Apr 2024 at 11:16:38
    Re: How to select default value of dropdown based on Previous entry in Sharepoint List

    Hi can you help me I am getting error in formula

     

    This is my preview page

     

     

    dropdown1.png

     

    this is my items page in dropdown

     

    dropdown2.png

     

     

    This is my code in default property of dropdown but i got error lookup function is not supported and employee mail isnot recognized and my requirement i also want to update the formula samewise for if new value selected in dropdown

     

    dropdown3.png

     

    if picture is not visible this is formula:

     

    If(IsEmpty(Filter(EID,EmployeeEMail=Office365Users.MyProfileV2().Mail)),"old", Last(SortByColumns(Filter(EID,EmployeeEMail= Office365Users.MyProfileV2().mail),"ID",SortOrder.Ascending)).'Tax Regime')

     

    Please help me to resolve this issue

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard