cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (46,659)