cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SinanALMAC
Regular Visitor

Save project button is notworkin in powerapps

Hi All,
I used a template app to collect project demand. template name is  Service desk.

It used collections and I chanced it to sharepoint list.  In this template everything  work perfectly  but  save procet buttons is not working. Is there  any idea why it isn't work.
 here is my  save project button code

If(CreatedBy.Text="" || Dropdown_Priority.SelectedText.Priority="Select a priority" ||Dropdown_Area.SelectedText.'Account Name'="Select an area" || Subject.Text="" || Description.Text="";
    UpdateContext({msg_visible:false});;UpdateContext({msg_visible:true});
    Collect(Projects;{ID:Value(Text(CountRows(Projects)+1));Owner:CreatedBy.Text;AccountName:Dropdown_Area.SelectedText.'Account Name';Priority:Dropdown_Priority.SelectedText.Priority;Subject:Subject.Text;Description:Description.Text;Status:"New";DateCreated:DateTimeValue(Text(Today()))});;
    
Navigate(DashboardPage; ScreenTransition.None))

 

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @SinanALMAC ,

I have parsed this for you to get a better look

If(
   CreatedBy.Text="" || 
   Dropdown_Priority.SelectedText.Priority="Select a priority" ||
   Dropdown_Area.SelectedText.'Account Name'="Select an area" || 
   Subject.Text="" || 
   Description.Text="";                  //end of "if" part
   UpdateContext({msg_visible:false});;  //"Then" part   
   UpdateContext({msg_visible:true});    //"Else" part ?
   Collect(
   Projects;
   {
      ID:Value(
      Text(
         CountRows(
         Projects
         )
         +1
      )
   );
   Owner:CreatedBy.Text;
   AccountName:Dropdown_Area.SelectedText.'Account Name';
   Priority:Dropdown_Priority.SelectedText.Priority;
   Subject:Subject.Text;
   Description:Description.Text;
   Status:"New";
   DateCreated:DateTimeValue(Text(Today())
)
	}
);;
    
Navigate(DashboardPage; ScreenTransition.None))

I think this bit

UpdateContext({msg_visible:false});;     
UpdateContext({msg_visible:true});

Should be

UpdateContext({msg_visible:false});     
UpdateContext({msg_visible:true});;

Without looking fully into your logic, are not these two statements alternates and should be separated by an "else" operator and then continue on to the Collect function? 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi  @WarrenBelz


Thank you for your reply

I have tried your solution but it didn't work. But It works perfectly when I use it as the data as a collection instead of a Sharepoint list.
I think there is a difference between the SharePoint list and Collection When I use it to get the data with "collect" function. Do you know another function to use add the data to SharePoint?

Best regards
Sinan

Hi @SinanALMAC ,

Sorry for the delay - I missed your reply in my feed.

A collection is a temporary table containing the information you have "collected" from the data source.

You can "Patch" data from a collection to a SharePoint list - here is some documentation on it.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,086)