SharePoint 365 - creating workflow with dynamic approver name from InfoPath file - sharepoint

Hello SharePoint ninjas!
Could you please advise me how to create the SharePoint 365 workflow for InfoPath for file that has dynamic approver1 name (by this I mean it directs the approval flow to user picked by people picker in InfoPath file).
The InfoPath file has been succesfully published on site's form library, user enters this file/form and after submission it creates an XML file. I want this XML file (with one of rows being the name of Approver1) be the object in the approval flow.
Thank you for advise,

SOLUTION: putting the field to column of Sharedrive, then 'Get user profile'.
To prevent dealing with array/for each I have used Parse JSON/Select.

Related

How to add a new record in a document Library on sharepoint using a input form on PowerApps?

I have a PowerApps application where I have a input form that stores data on a list on SharePoint.
That works great with "SubmitForm(form_1);" as it nicely creates a new record in the list on Sharepoint that is connected to that input form on the PowerApps apllication.
But now I have to do the same but instead of storing it on a list in Sharepoint I need to create a new record in a Document Library on Sharepoint.
When I connect that library to the application and try to do the same using "SubmitForm(form_1);" I recieve next error:"The requested operation is invalid. Server Response: Test: To add an item to a document library, use SPFileCollection.Add() clientRequestId: ...."
Is there a way to store a new record on a document library in Sharepoint using a input form on PowerApps?
Thanks in advance !
Kind regards,
Steven

Sending email through SharePoint designer 2013 workflow

I'm trying to send an email to a person who submitted a new project request as part of a SharePoint Designer workflow using a project detail page (PDP) in Microsoft Project Server 2016.
Email recipient will be different in each time since different people can submit a project request and the workflow needs to determine the email address of the person who submitted the request and emails the person.
I cannot find a way to set up the email recipient in SharePoint Designer 2013 to accomplish this task.
I found the following URL on this subject http://mundrisoft.com/tech-bytes/how-to-send-an-email-using-workflow-when-items-are-created-or-updated-in-sharepoint/.
However, the step 6 on this page does not provide enough details on how to set up the recipient email automatically in the SharePoint Designer 2013 workflow.
Is this possible? Can you please help?
Thank you,
Have you selected the "directory book" to the right of the To: field? If so, what options do you see available?
It's pretty straight forward
In recipient field To: click on directory book then select "Workflow lookup for user" in menu, then in Data source give Workflow context and select Initiator. It will be the user who initiated the workflow i.e added in new request OR if the workflow is set to run on Item Edit as well then "Initiator" can also contain the user who modified.
see snapshot
BUT since Current Item is also available in menu you can always select "Created by" "Modified by" fields in recipient list against label To:

Sharepoint Infopath form read only after submitting

I have an infopath and deployed it to sharepoint document library. When i click on the add document in the library infopath form will open and user can fill the form and submit it. The form will be send for approval. But when any user clicks on the existing form present in the library then the form should not be in edit mode. User should not edit the form they should get only the read only form. How to implement this.
You can set hidden field with submit rules. Then in open form rules check this field and show read only view if field is checked.
But keep in mind - user can simply download form as xml, edit it in notepad and upload. You may set interface to read only, but if you don't set permissions on form items - user will can edit it.

SharePoint list template migration error

Goal: Move SharePoint list from old site collection to new site collection.
Approach:
I save the SharePoint list as a template (.stp),
Then move .stp file to the new site collection list template gallery
Create custom SharePoint list using my newly created template
The SharePoint list populates perfectly.
Problem: when I try to edit or add items to the SharePoint list, I’m taken to the default SharePoint page “An unexpected error has occurred”
Open you web.config file of the SharePoint web Application, search for CallStack change it to true and seach for CustomError and set its value to Off. Do the action again you will get to know the actual error causing the error. Rectify it or post the error that will help to point out the issue.
Also notes in case of STP,
If have some LookUp field in the List template, you will need to recreate those fields again or Follow the workaround as described in article
If you have created any Site Column make sure that is there in the new site collection as well.

How can I validate within an InfoPath form whether a user exists within a SharePoint Portal?

I am creating a form within InfoPath which is to be integrated into a SharePoint 2007 Portal. Within this form there will be a textfield into which a user can enter the Name of a Person.
How can I validate whether this Person exists or not?
Instead of validating the user, is there a way to fill a dropdown List with all usernames of the portal? (which of cause would be users from the Active Directory)
I haven't done this specifically, so there may be a better way, but I've been pulling a lot of data out of SharePoint and into an InfoPath Form (deployed to a SharePoint forms library and accessible through SharePoint Forms Service with MOSS Enterprise) and also going the other way using the SharePoint web services - very quick to use, and the person web service is right there.
Have you tried looking at the Contact Selector (an ActiveX control). Here is a MSDN-article describing how to add it as a control in InfoPath and this one describes how to make it work.
I have been using it in the majority of my infopath projects and it works flawlessly - also for browser-enabled forms.
When doing something similar in an ASP.NET application, I've used the Sharepoint search and searched the "People" Scope for the specific user. You can also search across profile information so you can pull back everyone with a certain Job Title, or in a specific Department.
I don't validate a person's existance, but I do determine a person's full name using their login and SharePoint. You should be able to modify this code for your purposes, it is below. For it to function you need a data connection in your InfoPath document called GetUsersFromSP. Configured as follows:
Location is - http://njintranet2/_vti_bin/usergroup.asmx?WSDL
Operation is – GetUserColectionFromSite (last one on list)
Automatically retrieve data when form is opened should be checked.
string ADName = System.Environment.UserName;
IXMLDOMDocument3 UserQuery = (IXMLDOMDocument3)thisXDocument.GetDOM("GetUsersFromSP");
UserQuery.setProperty("SelectionNamespaces",
"xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\" " +
"xmlns:tns=\"http://schemas.microsoft.com/sharepoint/soap/directory/\"");
((WebServiceAdapterObject)thisXDocument.DataAdapters["GetUsersFromSP"]).Query();
IXMLDOMNode Users = UserQuery.selectSingleNode("//dfs:myFields/dfs:dataFields/tns:GetUserCollectionFromSiteResponse/tns:GetUserCollectionFromSiteResult/tns:GetUserCollectionFromSite/tns:Users");
foreach (IXMLDOMNode current in Users.selectNodes("tns:User"))
{
string Login = current.attributes.getNamedItem("LoginName").text;
Login = Login.ToUpper();
if (Login.EndsWith(ADName.ToUpper()))
{
thisXDocument.DOM.selectSingleNode("my:root/my:config/my:User").text = current.attributes.getNamedItem("Name").text;
break;
}
}
Use this control:
http://blogs.msdn.com/infopath/archive/2007/02/28/using-the-contact-selector-control.aspx
Or if you want to build your own validator, you'll need to query the SharePoint profile database. I'd recommend this over querying AD directly. There's lots of articles online about working with the profile database.
Have a look at this Link, it explains how to populate a dropdown with the SharePoint Users
http://blueinfopath.blogspot.com/2008/10/how-to-populate-list-with-sharepoint.html
I you want to validate,
- Make a textbox
- Add a Button, name it ValidateUser
- Create a Receive Connection to the ......
- Att Rules to the ValidateUser
- Add the textbox to the field AccountName in the Secondary Datasource
- Execute the receive connection
- Get the value of the field Value with filter Name="PreferredName"
This work for Infopath Form Services
Test it and enter the UserLogin into the textbox and click on the Validate Button
Frederik

Resources