Is there a way to automate the updating of field names in a Custom Expression in Tibco Spotfire? - spotfire

I have Spotfire dashboards that use Custom Expressions in their visualisations. The name of a database variable was changed at source in SQL Server, so I replaced the column in my information link with the new column name and reloaded my data.
I was given an option to match 'old column name' to 'new column name', which I did.
My problem is that any Custom Expressions that used this 'old column name' have not updated to the 'new column name' in this process, and consequently there are many errors. This column is used in custom expressions for dozens of KPIs and charts, to manually go through them all will be time consuming.
Does anyone know of a way to update a column name so that it will update every custom expression in a dashboard?

I don't think there is a way to programmatically update all of the expressions. It's frustrating that match columns don't actually update thru all functions in the application. However, you might try adding in a change column names transformation to change the column name back to the old name, and then your calculations would update.

Related

Using Power Apps to add a new value to a multiple-value choice column in SharePoint without overwriting existing values

I have a SharePoint list that contains a choice column with the 'multiple selection' option turned on. Each item in this list contains data related to preferences for a given user, and the choice column will store the IDs for each of the user's 'favorited' reports.
I would like to write a Patch formula in Power Apps that writes a new value to this column, but retains the existing values. Here is an extract from my current formula, triggered when a user selects the 'Add To Favorites' button, where 'Favorites' is the choice column that already contains values:
Patch(
'Platform User Preferences',
LookUp(
'Platform User Preferences',
UserEmail = User().Email
),
{Favorites: [ThisItem.ID]}
)
Current state, this formula overwrites the existing values in the choice column with the new single value, instead of adding it alongside the existing values.
One approach I have attempted (based on reading similar use cases online) is to create a collection from the Favorites column, add the new value to that collection, then patch the entire collection back to SP. However, I have had similar problems doing this as I do not fully understand the model of a collection that is based on a multi-value choice column. For example, the following also appears to completely wipe the data in the collection, rather than add to it:
ClearCollect(favslist,Filter('Platform User Preferences',UserEmail = User().Email).Favorites);
Collect(favslist, {Value: ThisItem.ID});
Any help with solving this problem would be most appreciated!
You'll need to create another collection that contains each selection of the existing favorites. Right now your 'favlist' collection contains one item that contains all the existing favorite selections, then youre adding you new item. This isn't formatted correctly this way.
Try updating your existing code before you patch, by using a ForAll and collect the existing items:
ClearCollect(existingfavslist,Filter('Platform User Preferences',UserEmail = User().Email).Favorites);
ForAll(existingfavlist, Collect(favslist, ThisRecord.Value));
Collect(favslist, {Value: ThisItem.ID});
Then just patch your collection 'favslist' to the list

How do I update a list item after adding it with Power Automate

I can't figure out how to do a very simple update of a column value in Power Automate in SharePoint online. I've seen examples of how to update an item on another list, but nothing that updates a value on the same item that was just added and triggered the workflow. Can anybody give me an example and maybe a very brief explanation?
I want to multiply the values of two columns and add it to a third column on the same item which will be blank. I used the formula to update the column I want using values from other columns. =[Dollar Amount]*[% Chance] but it says invalid syntax. There seems to be nothing intuitive in this new power automation and it's a horrible failure compared to how easy it used to be. MS is always making these mistakes.
The first method, you could use a calculated column.
=[% Chance]*[Dollar Amount]
Second method,use Flow.
Test result:
It's Power Automate, not power automation. Details matter.
First, try to set the column value when you create the item. Then you won't have to edit it. If you already know the values for [Dollar amount] and [% Chance] (Chance, really? Or Change?), then you can use these to generate the value before you create the item. You can do that in a variable or with a Compose action. Then create the item and refer to the variable or the Output of the compose action.
If this is not an option, you can use the Edit Item action and get the ID for the item from the action above that you used to create the item.
You say "MS is always making these mistakes." - It's more likely that the problem is a mismatch of data types, e.g. using text fields in calculations, or typos, or wrong syntax. That's not a mistake made by MS. Again, details matter.
Edit after comments: If the workflow is triggered by an item getting created, then you can use an Edit Item action and refer to the ID from the trigger item.

Spotfire - Adding dynamic date restriction to data table which is based on an information link. Spotfire 6.0.1

I have an information link that I want to restrict in spotfire when I add it as a data table so that certain data is excluded. I want to restrict column 'DAY' to the past 91 days.
These are the steps I have tried that haven't worked:
Added data table and clicked 'load on demand' (in the 'Add Data Tables' window) and then 'settings'
On the 'DAY' column, clicked 'Define Input'
Chose 'Range(fixed/properties/expression)' as the 'Input' for the selected parameter
Then as the 'expression' for the 'Min', used: DateAdd('dd',-91,DateTimeNow())
It returns an error when I try to add a transformation to the data or just returns no data when I add the data table. If I just restrict the data with a fixed value it works as expected but clearly this would mean that I would need to change the restriction everyday. I have also been able to restrict the data to a static date directly on the information link under the 'Filters' heading. What I really need is a dynamic restriction that is placed on in some way, in Spotfire, rather than directly on the data source (Oracle).
Would be grateful for any help! Thanks!
It couldn't recognize DateTimeNow(), which is a DateTime as a Date. Spotfire gets kind of picky about that sort of thing.
Replace the Expression used for Min with
DateAdd("dd",-91,Date(DateTimeNow()))
and it should work.

Changing Custom site column to lookup

I got thrown in to a situation where the customer has a production enviroment and needs to make some changes without losing data.
One part of the problem is changing a sitecolumn (used in CT, 2-3 lists, and multiple web parts as custom property) from a text field to a lookup.
I have tried to set the schemaxml via powershell and push the changes to the lists. I get errors.
I have also tried to update the column in the list with lookup schemaxml.
If i remove the sitecolumn and create a new the webparts stop working, since they need the sitecolumn.
What would be the best solution for solving this?
#Simon if you try to replace column type from text to lookup, you will lose data for sure.
Create extra single line of text column 'Backup' in the list.
Write powershell script to copy the data from current text column to Backup column.
Change type of column from Text to Lookup.
Use Manual or powershell approach to rewrite data in new column.
Delete temporary backup column.

SharePoint Web Parts can not be connected via hyperlink fields

In short:
I'm trying to filter an XSLTListViewWebPart based on what is selected in another XSLTListViewWebPart. Using a String field as connection this is working fine. Using a hyperlink field no data is displayed.
In more detail:
I have two lists, say Accounts and Projects. Both have a hyperlink field accountURL.
All accounts have different accountURLs. Different projects can have the same value for accountURL. Both are displayed on a page using the XSLTListViewWebPart.
The simple goal is to filter the Projects list based on which item is selected in the Accounts list using the accountURL field. So I established a web part connection using the acountURL as a filter. Alas, when an item in the Accounts list is selected no items are showwn in the Projects list although I double checked that there are matching values.
When using a string field instead of a hyperlink field for accountURL everything works like a charm. Problem is, I need the hyperlink field.
Is this desired behaviour? Do you have any suggestions for a workaround?
(I already tried converting the hyperlink field to a string field via a calculated column which did not work out either.)
All was and is to be done in the web interface or SP-Designer. Coding a WSP is not an option for this problem. As I'm not quite familiar with the correct terminus technicus I use field and column interchangeably.
All help is greatly appreciated.
Ben
Someone on the Microsoft forum suggested the following workaround which does its job well:
Add a hidden text column to both lists.
Use a workflow which is triggered on item creation and update to copy the value of the hyperlink column to the hidden text column.
Connect both webparts using the hidden column as filter.
Nonetheless, I still wonder whether it is possible to use hyperlink columns or other special columns for filtering. I also had the problem that I cannot use a person column as lookup.
Does anyone know if whether there ist some kind of overview
which column types can be used for filtering/formulas/lookup/...?
Cheers,
Ben

Resources