Adding/removing rows form a repeating table linked to a secondary data source - infopath

I have some data I want to fill in when my form opens, so I created an XML-file-based secondary data connection (it has to be a secondary connection, not the primary) with some sample values with the intent of later removing them and replacing them with real values. It basically looks like this:
<root>
<entry>
fields here
</entry>
<entry>
fields here
</entry>
</root>
(The second entry is so that InfoPath knows it has repeating values.)
I then bound <entry> to a repeating table in my form.
But when I open the form, there are exactly two values, and the options to allow adding/removing entries are greyed out. InfoPath knows that this is a repeating element, otherwise I wouldn't be able to bind it to a repeating table.
How can I change this to allow adding and removing entries?

Apparently, secondary data sources cannot be modified. I found this information in the InfoPath help.
Modifying secondary data sources
Because the fields and groups in secondary data sources are based on data connections to external data sources, you cannot modify the fields and groups in a secondary data source. When you view a secondary data source in the Data Source task pane, the fields have the locked field icon and the groups have the locked group icon to indicate that you cannot modify them.

Related

Blueprism - Extract data from a web page into a collection

I am new to blue prism. I have a scenario where I am giving input (passengers details for traveling) to a travel portal and based on the input its generating a booking reference number, total cost etc. Now I want to read all the outputs into a collection but the problem is data is not tabular (cant use Get Table in read component). Its just the details of travel which are populating into textboxes. Please find attached the screen shot to have more clarity on this.
How to achieve this? Any leads will be appreciated.
Based on the screenshot you've provided, this is part of the Blue Prism Advanced Consolidation Exercise ("BPTravel").
"Get Table" won't work on this data because it is not a table. As you've mentioned, the data is presented in a series of textboxes.
The way to tabularize this data would be to create a Collection in your Process and manually define each of the Field Names in the collection, then read each text field in individually to the correct column in the collection.
Read each text box data into data item. Create a named collection (i.e Collection with pre-defined column name). Loop through the collection.column_name(You will be getting column name as collection by using Utility - Collection Manipulation action and get the column names) and first add a row to collection and assign values to collection fields

Return one record from a form data source

I have a form with an existing data source. This data source has a one to many relationship to another table that is not an existing data source. Even though this second table contains multiple records (one to many), the field in the table that I want is duplicated across all records. Therefore I want to add this second table as a data source, but only return one record from it.
If I add the second table directly, than my form contains a line for each record instead of just one.
This problem was solved by creating a view to use as the new datasource. This view defined a calculated column that was based on a method that contained a query string that used TOP 1. The details in much more detail are at Martin Dráb's blog: https://community.dynamics.com/ax/b/goshoom/archive/2015/06/29/join-first-line-in-ax-2012.
Use the property LinkType=ExistJoin on the datasource for your second table.
See the TransactionLog form for example.

Link to primary and secondary data sources in Tableau

I’m trying to create a dashboard filter in Tableau. All but one of my graphs have the same primary data source A. The filter will affect all these graphs as intended. However I have one sheet where the primary data source is B, and the secondary data source is A. I can’t get this particular graph to link to the quick filter I’ve created. Does anyone know of a workaround for this?
The easiest way to filter multiple data sources from a single user control is to use a parameter along with calculated fields in each data source that reference the parameter setting. The calculated fields can then be put on the filter shelf for the appropriate worksheets.
This solution doesn't fit every circumstance.
Parameters can only have a single value, and the list of arbitrary values must either be defined statically in the workbook or allow the user to enter an arbitrary value. You can't dynamically lookup the list of legal parameter values in a database table (although you can use a field to populate the list initially).
Parameters are independent of any data source.
So if these restrictions don't hamper your use case, then you can have one parameter control on a dashboard that influences the filters applied to many worksheets. The simplest calculated field used for filtering could just say [My_Field] = [My_Parameter]. You can allow extend this idea to define parameter values that reference multiple choices like: "A", "B", "A and B" and then adjust your calculated fields accordingly. At some point, this approach gets unwieldy.
Another approach is use a worksheet as a filter, by displaying marks for each option, and then using filter actions to use the selected marks to filter other worksheets. This approach allows multiple selection, and dynamically loading choices from a database table.

Lookup field appears as numerical values instead of text on Access report

I am trying to create a report putting a field called contact which has the name of a person. This name is linked directly to another table where I keep all the contacts.
For some strange reason, when I include this name (which in query view displays as the name of the contact), instead of the name appearing, the unique ID number is shown on my report.
As mentioned in the article cited in the above comment, you can use a Combo Box control on your report to do the lookup for you. To see how this can be done, create a new report based on the table containing the lookup field, then drag and drop that field onto the report. That will create a Combo Box control with properties that look something like this:
Row Source: SELECT [Clients].[ID], [Clients].[LastName] FROM Clients;
Bound Column: 1
Column Count: 2
Column Widths: 0";1"
You could use a similar Combo Box control on your actual report to display the client's name rather than their numeric ID value.
Another alternative would be to change the Control Source of the report's Text Box control to have it do a DLookUp() on the table. If the lookup field is named [client] then changing the Control Source of the Text Box to something like
=DLookUp("LastName","Clients","ID=" & [client])
would also work.
I wanted to add to the great answer by Gord:
When using a "web" database (started in Access 2007 I think), you cannot change a report's fields to ComboBox style, nor can you use DLookUp(). (web databases lack a ton of features)
The workaround for this, if you want to create a Web-Report that uses lookup fields, is to create a Web-Query first based on your Web-Table (all the Web-* stuff has a www planet icon over the logo, if you create a new Web-DB in Access 2007+ you'll see what I mean)
So, instead of Table -> Report, you'll have to do W-Table -> W-Query -> W-Report.
Then, the only thing you need to customize to get the data right is the W-Query. Start by trying to reproduce the look in the query to match what you want users to see in the report. Note that here in the query, lookups will work fine (instead of the unique ID's, you get field names like you want). However, this will not carry over to the report. To do that, you gotta get the actual text field name you want into the query:
You should already have one table in your query; start by adding the table that your first lookup field points to. For example, the table I want to print is called Stock_Boards, and it has a lookup field called PCBID_lookup that points to the table Stock_PCBs.
Since you're using lookup fields, there should already be a relationship line between the two tables when you add the second one. If there isn't, something has gone horribly wrong.
Now, see how that line connects two fields on the two different tables? For example, I've got my PCBID_lookup field on my Stock_Boards table, which connects to the ID field on my Stock_PCBs table. If I created a report from this now, PCBID_lookup would be a number, a number that correlates to the ID of a record on Stock_PCBs.
To fix it, I will add the name field I want to show up on the report. In my example, that happens to be a Part Number, rather than the ID. I add the PartNumber field from my Stock_PCBs table to the query, and remove the PCBID_lookup field of the Stock_Boards table from my query.
Since PartNumber is what I want to show up on my report, it effectively replaces the original field (PCBID_lookup)
Repeat for all lookup fields you want in your report.
I had 1 more: I removed the Status field of the Stock_Boards table (which was an ID/Lookup) and added the 'Status' field from the Status table (which was the actual text name)
When finished, your query should look exactly how you want the data to appear, without any special tricks or asking Access to do something unnatural. Save your query, and create a web-report from it. Done!

Display CSV dynamically in MVC3 view table

A data provider is giving us dynamic report data in a SQL Server database table X. There is also a metadata table Y which holds the report count and the columns (as a semicolon separated string). In the report data table X, there is a text field which holds all the data, separated by semicolon. The provider is doing this to be dynamic, and I can't influence that choice.
I need to:
Load the metadata from Y
Load the data from X for a selected report from Y
Display the data in a table on a webpage
How would you go about reading this in the model/controller and displaying it in a webgrid/table? For models with fixed columns, this is simple, but what about when the columns are dynamic?
Current solution (feels dirty) is to parse the data into a DataTable and manually output rows and table cells in the view from this object. No use of WebGrid, MvcContrib Grid etc.
I chose to parse the table data into a specific dimensional model in my MVC application:
Base objects
Report
Column Definition
Data Row
Report has a list of column definitions and a row count integer. It also has a list of rows. Each row has a list of column values (cells), which is always treated as string in this code, and only displayed using the display data type from the column definition.
My data types defined are for example: text, date, number, link (many types of links to our CRM system, accountlink, userlink, orderlink). I add new data types only if I need to display them differently than the existing ones. I can imagine some day I need a chart data type (where the cell data is a list of plot points for example).
This makes the report definition very flexible, but I am probably sacrificing some performance and it is purely custom. I would still like input on this approach, but no responses in the last 6-7 months probably means this is a weird enough scenario that you, the reader, should avoid.

Resources