Infopath: Include data for active form only is grayed out - sharepoint

Here's my workflow:
An item gets added in a Sharepoint List (Say x). At that moment, a workflow triggers and starts a data collection task. For this task there is an Infopath fom which needs to collect some data from the user
This form has some fields which are to be fetched from the corresponding Sharepoint list item in list X and displayed in the form
I am trying to setup a data connection with the list X and fetching the fields of my interest.
However, the option "Include data for active form only" while setting up the connection is grayed out.
I am not able to get the right results in the form from the data connection, the data is not being returned for the right SharepointList item. THe data being returned is for the first item in list X.
Thanks!

This is because you are not passing a filter into the data connection. You are querying the list without an ID and since you are not selecting a specific list item it is just returning data from the first list item every time.
You are going to need to select a unique identifier and filter your result by clicking the add filter button and setting the foreign key = to primary key in list x. A quick google search of add filter to data in info path should give you an idea of what I am describing.
You may need to add a column in your initial table that imports the key from list x as a foreign key in your initial list.

Related

How do I use a power apps form for a lookup column?

I have a SharePoint List (say "List-A") with plenty of columns, some of which are lookup columns.
These are just used to construct a choice columns, where the items in the choice drop down are the items of a column in a different List ("List-B").
I have used the function on SharePoint to integrate List-A with Power Apps Form. This creates a Power Apps form that is readily available.
For the Lookup choice columns, I have added List-B as the data source, and am using the items from the correct column as items in the choice that is linked to the lookup column. This correctly populates the drop down menu as expected.
Now when I publish this form and fill it from sharepoint (it pops up as it should hafter clicking New in the List view) I can fill the entire form and submit with no issue. However all the lookup columns remain blank, as if the form returned a null value instead of the selected.
I have both datasources set up:
The update property of the datacard connecting to the SharePoint List is equal to the Selected of the datacard containing the combobox (combobox is called DataCardValue43).
The items property of the combobox is equal to the correct column of List-B.
As an alternative solution, I have attempted to make a different column that is just one line of text. For this column, I have made a combobox once again setting the items property to the column in List-B. The intention was to return the selected value as a string. It was attempted thus:
where combobox1 once again manages to give the correct options in the drop down box but returns only Null.
To study it further, I have made a power apps flow that takes Create New Sharepoint List object as input. Here I see that the values are indeed Null
The one called "Return" is the text column that I made, and the other being the lookup column. I do notice that the Lookup column isn't called Value, but id. I don't know what to do with that information though.
I really just want to have a column in my power apps form that lets you choose and the choices are values from a column in a different List. What do I do, and why doesn't what I've already done work?
Thank you.
Please follow the steps below to solve the issue.
1: Add a Lookup column in SharePoint List.
2: Open that list in Power Apps by using the Customise Forms Option From SharePoint.
3: The Item property of Lookup field will be by default as follow:
Choices([#'CustomisingSharePointList'].LookupColumnListName)
4: There is no need to change/delete the lookup field with any custom dropdown or combo box. This is the point, where you are doing mistake by adding a custom combobox and replacing the original Lookup dropdown. If you want to change datasource, apply filter or sort the data, you can do all these thing to the same original lookup column.
e.g I have applied filter and sort functions to the existing data:
Sort(Filter(Choices([#'CustomisingSharePointList'].'LookupColumnListName'), Value in Filter(LookupColumnListDataSoure,Progress.Value = "Open").ID),Id)
5: When you will publish the list, it will work fine.
Note:
CustomisingSharePointList: List in which we have added a lookup column.
LookupColumnListName: List to which the lookup column actually belongs to.
LookupColumnListDataSoure: You need to add the original list as data source in power apps to use the above filter. This step is optional and applicable only if you apply filter like I did in step 4

Adding data from one list to another with correct ID of list item SharePoint

We are trying to get around the limitation of Field Permissions in SharePoint by creating a second list which will allow users to edit what they are allowed, instead of the whole form. In this case, it is on field that is set to Person or Group (Dashboard). For reference, the Person or Group gets info from AD, I am not sure if that is standard or not info but thought to add it in.
We have created a second list that has two fields, one being a Person or Group (AddToDashC) and the second being plain text (CopyName), where a workflow triggers and sends the Person or Group to plain text as Display Name, as that is what shows in the Person or Group. Last Name, First Name. This workflow works fine.
On the main list, we have separate list items where the Dashboard field can be edited, being unique for each list item. I can’t figure out the logic to be able to match the IDs up so that we can transfer the CopyName information to populate the correct list item ID through a workflow. We have a Lookup on the first list (AddtoDashWFC) which grabs the plain text form, CopyName, but just trying to figure out how to populate it properly.
I was hoping to have an edit link next to each list item in the column, which will go to the second list but still link to the report through the ID.
Sorry for the seemingly basic question, I just can't get the logic.
List 2 Workflow so far
List 1 Workflow so far
Thanks,
Patrick

Move element from list to another list in sharepoint with powerapps

I have two list in sharepoint and an application in powerapps. I can create an element from form and save into a one list of sharepoint.
But I would like to, from a dataTable in powerApps (that it list elements of sharepoint list), move selected element to another datatable (connected to another sharepoint list).
Thanks
You can do that by first adding the element from the first list to the second list, then removing it from the first list. For example, the screen capture below shows one such example (it uses SQL Server tables, but the idea is the same for SharePoint lists):
Patch(
'[PowerAppsTest].[deleteme20190726b]',
Defaults('[PowerAppsTest].[deleteme20190726b]'),
{
Name: DataTable1.Selected.Name,
Age: DataTable1.Selected.Age,
IsHuman: DataTable1.Selected.IsHuman
});
Remove('[PowerAppsTest].[deleteme20190726a]', DataTable1.Selected)
The first Patch command will take the properties from the selected item in the left data table (whose Items property points to the first table/list), and add a new record to the data source that is bound to the second data table. After the item is inserted in the second data source, you can then use the Remove function to delete it from the first one.
Hope this helps!

Microsoft Powerapps - How to connect to different datasource in one form

I'm building an app for TravelInfo. Here are the fields: From, To, City, Country.
I am using common data source entity. And for the country lookup, I want to use a sharepoint list, that has all the country names.
I'm stuck at this stage. As you see in the snap, I want to connect the country dropdown to a sharepoint list.
[I've tried to achieve the same with picklist. But Its not good to manually create the huge list of countries in picklist. Sharepoint list should be ideal.]
Here is the question: In one form, how can I use different datasource for different fields??? Please help.
A form will save the data card value defined in Update into the field defined by DataField. You are trying to change data displayed on the dropdown which is not set in the Fields list you have above. Try the following (the first few steps may already be completed based on picture):
Check Country to insert data card into form
Select data card and under Advanced properties click Unlock to change properties
Delete text box from data card that was added by default
Select data card and insert desired control (drop down box)
Select drop down box (not data card) and under Advanced properties define Items and Value to populate values from the sharepoint list
Select data card and change Update to desired dropdown value that should be saved e.g. dropDown1.Selected.country_id
The drop down box can display the Country text on the form, but then save an associated value such as the country id.

Joining sharepoint 2007 lists in a web view based on a common key field

So - I'm making a data view that is to contain a list. This list has a field that will be used to match up against two other lists. If there is an entry for this value, it should show the value from the other list, otherwise show a link to add a new one.
So, what I need to do is make a data source consisting of the rows from list 1, and fill in the Ticket field with a value from the Tickets table matching the ID value from list 1. The same should be done for the Change Type field.
Can anyone point me in the right direction to accomplish this? I've found a few tutorials, but they seem to be for showing all the data together and not match up on any specific columns for linkage.
Thank you
What you are aiming at is not available in SharePoint out of the box.
There are two approaches you can look at:
Create your own custom lookup field template for single/multiple field
selection with some sort of field
editor. Create your own controls and
program the associated code behind
logic.
Use some existing custom solutions. One such sample is on codeplex:
SharePoint Filtered Lookup Field

Resources