cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sidhant_02
Post Prodigy
Post Prodigy

To change the status of an item on-click and show show items based on status of user to admin

Hi everyone,

I have a course screen where I am displaying list of courses (from a SharePoint list named: Course List) which is like this:

Sidhant_02_0-1683097376694.png

I have used a Horizontal Blank Gallery in which I have used a Image (common to all courses), three text labels (for title, description and Difficulty)

Sidhant_02_0-1683105015524.png

 



So currently on the Course Information screen I am displaying Title, Description, and Difficulty (this is a Choice field) the SharePoint structure look like this:

Sidhant_02_1-1683097557442.png

So now I want to add a button (which looks like Text) which is used to denote the status for the particular course which has values like Not Started, In-Progress and Complete.
Example: Assume a Tim has logged in to the application -> He navigates to the Course Information screen -> Chooses  the course category (here: Beginner) in the course list and there we have an attribute which is changes its value (like a choice column) on-selecting it (don't want to use drop down to change the value) the value should be changed on-click and saved to the sharepoint. By default the value will be Not started. I wanted something like the below picture: (Wire frame)

Sidhant_02_2-1683097949845.png

Something just like this:

Sidhant_02_0-1683104179699.png

Sidhant_02_1-1683104239643.png

 


So when user clicks on the status:
Initially it is set to Not Started (once they click it is changed to)-> In-Progress ->  Completed this should be the sequence when user clicks and this should be saved in SharePoint list (for which I was thinking of creating a Choice column named: Status with values 'Not Started', In-Progress, Completed)
So what modifications should I do to get this functionality?.

The other requirement was when a user with Admin role logs in there will some change in the Course List page. Instead of having a drop-down which shows Difficulty (Choice column) values like Beginner, Intermediate, Advanced. I want to show all the list of users and on selecting a particular user the Administrator should be able to see all the Course information for that user.

Example: Assume Tim has 2 courses which he has started one from Beginner and one from Advanced (difficulty), so if admin selects Tim from the users drop-down then they (user with Role: Administrator) should see all the courses along with the status for that particular user, in this example it should the status of one course from Beginner: difficulty as Status: In-progress and one course from Advanced Status: In-Progress and rest of the course status should be Not Started


The wireframe:

Sidhant_02_0-1683201302730.png

So I have a created a button (which looks like text) and added a label beside it which displays the Choice column value (have added Status which is a choice column with default value as Not-Started) but not sure how to update the value on the go when the button is clicked

Sidhant_02_1-1683201407195.png

 

On clicking Button16 the status column should be updated and saved in SP list and displayed in the label.

Note: I also tried removing the Choice column (Status) and added it again (Refreshed the SharePoint List) but still not able to get the Choice column in the expression

Sidhant_02_0-1683624018832.png

 

 
 
Regards, 
Sidhant.

41 REPLIES 41

In that instance youd likely just want to create a new record for each user the first time they goto the course page in its on visible. Then filter the gallery to first only show ones where the employee info matches.

 

 

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

Not a new record but only for the Status column filter it based on which user has changed it so in this case will a new column be required?.
Or it can be done with a variable.

Sidhant_02_0-1683699681579.png

This is the SharePoint list which stores the credentials of all the registered users in my application.

Regards,
Sidhant.

Hi @TheRobRush ,
As per your suggestion for testing purpose I have created a new SharePoint List named TrialList for testing purpose only. In which I am having 5 columns FirstName (Title column: created by default in SP), MiddleName, LastName (of Type Single Line text), Stage (Choice column with 3 values: Not-Started, In-Progress, Completed) and another Single Text column named StageText as you did suggest to use a Text column instead of Choice column.

The New SharePoint list for Testing purpose:

Sidhant_02_1-1683710547473.png

 

Code used on Stage which is a Button (used to change the Choice column)

Switch(
ThisItem.Stage,
Blank(),Patch(TrialList,ThisItem,{Stage: "Not-Started"}),
"Not-Started",Patch(TrialList,ThisItem,{Stage:"In-Progress"}),
"In-Progress",Patch(TrialList,ThisItem,{Stage:"Completed"})


)


 

Sidhant_02_0-1683710483691.png

Sidhant_02_2-1683710662993.png


So I did check for the Column name in the List Settings (as you mentioned earlier) for both the new columns
Single Line Text:

Sidhant_02_3-1683711180260.png

And the Choice Column:

Sidhant_02_4-1683711247603.png


And I did try for Text column but still it was give type issue

Sidhant_02_5-1683711311461.pngSidhant_02_6-1683711328520.png



For Courses List SharePoint (this is the actual one where I want to make the changes), the Choice column name was same in the List Settings as well:

Sidhant_02_7-1683711443474.png



So what is going wrong?.

(If possible when you are replying back to this could you respond in separate expression for Choice column and Single Line Text column
Like: //For Choice Column:
(What's wrong)
Code

//For Single Line Text
)

Regards,
Sidhant.

Hi @TheRobRush 
I did try the above expression for a Choice column as well but getting the same issue:

Sidhant_02_8-1683712122805.png

Sidhant_02_9-1683712232905.png

 

  • You will need to hiver over each piece of the formula for a second or two, once you find the section that is wrong it should give you a more detailed error
_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

Hi @TheRobRush ,
So I did check by hovering over the error which was it was expecting a Record but instead it was getting a Table so to Patch a choice the syntax is : {Choice_Column: {Value: "The_Value"}}

Sidhant_02_1-1683780867938.png

 



So after making some change (removed '[]'):

Sidhant_02_0-1683780848235.png

So I did some changes in the syntax which were:

Sidhant_02_2-1683783585964.png

 

The errors were not there but similar to Bryan's reply i.e. @BCLS776  after pressing the button there was no change value was not patched to my SP list and not even displayed in the label which I have placed beside the button.

For Single Line Text, I did try this:

Sidhant_02_3-1683783868609.png

So I did make some changes:

Sidhant_02_4-1683784658948.png

 

Sidhant_02_5-1683784722062.png

 


And same thing on click of the button there was no change. The SP List has no values patched as I mentioned

Sidhant_02_6-1683784748482.png

 



(The Stage is a choice column), so Rob could you please share the way to change the status using a text column I will try that out and if you know what should be done do let me know for choice column.
@Pstork1 , @BCLS776 do let me know your solutions as well.

Regards,
Sidhant.

Pstork1
Most Valuable Professional
Most Valuable Professional

Use this check

If(
   IsBlank(ThisItem.Stage.Value),
      Patch(TrialList, ThisItem, {Stage:{Value: "In-Progress"}}),
      If(ThisItem.Stage.Value="In-Progress",
          Patch(TrialList, ThisItem, {Stage:{Value: "In-Progress"}}),
          false)
)

IsEmpty checks an object and IsBlank checks a string.  Your check should be IsBlank(thisItem.stage.value) .

Then check thisitem.stage.value="In-Progress". There is no reason to use the square brackets or First.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

What @Pstork1  has provided you in the last response works, you do need to change the last patch to Completed however like this.

 

 

 

 

 

If(
   IsBlank(ThisItem.Stage.Value),
      Patch(TrialList, ThisItem, {Stage:{Value: "In-Progress"}}),
      If(ThisItem.Stage.Value="In-Progress",
          Patch(TrialList, ThisItem, {Stage:{Value: "In-Progress"}}),
          false)
)

 

 

 

 

 


The first one I sent you worked as well, except for multi-choice columns where select multiple options was turned on, that's my mistake I should have asked how you had yours set up. Here is a video showing Pstorks code in action so you know it works.

 

https://www.dropbox.com/s/o275qnlbtf0wyc4/Untitled%20video%20-%20Made%20with%20Clipchamp%20%281%29.m...

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

Thanks @TheRobRush ,
For the response, I did your code and it worked. 

Sidhant_02_0-1683869839662.png


Just had one final requirement (I have used this on a dummy list for now, will be moving this code to my main list), which looks like this:

Sidhant_02_1-1683870006698.png

So now what I wanted was in my application there are some users that are registered.
Example: 
Lets say in my app there are 3 users: Sam, Tim, Lee
Sam logins in the application -> Navigates to Course screen and makes a change in the status of Beginner Difficulty course to 'Completed', so now only Sam should see the status for that Particular to Completed. For rest of the users (here Tim, Lee) they should the default value or there should be no change for them.
This should be done with the help of SharePoint list (here it is Login list in which I am having the credentials stored (like username and password), so using these details I want the app to display details for the respective users

If possible do let me know how to proceed?.

Thanks for the solution
Regards,
Sidhant.

Hi @Pstork1 ,
Thanks for the expression it was helpful, @TheRobRush just modified some part in your expression and it worked (as mentioned in his solution reply). Just had one request (this was the 1st part of my query) the other half I have mentioned in my reply to @TheRobRush so could you please have a look at it once and let me know how to implement it in my case (I am not planning to use the Microsoft 365 connector instead use the SP list to check who has updated the Status attribute)

Regards,
Sidhant.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (421)