Array
3 TopicsSharePoint JSON Formatting using split and the resulting array
Hello, at https://learn.microsoft.com/de-de/sharepoint/dev/declarative-customization/formatting-syntax-reference I did find this for the split operator: split: divides the given string into an ordered list of substrings by searching for the given pattern, and returns an array of these substrings "txtContent": "=split('Hello World', ' ')" returns an array with 2 strings - 'Hello' and 'World' This returns: Hello, World Now with that given - I use this: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "=split([$Supervisor.email], '@')" } This returns: first.name,domain.com It does what it should. However my question is how can I address the array? So for example that only the index 0 of the array will be returned? Means only: first.name Or index 1 of the array, which would return only: domain.com At the end I need all elements of the array to build a new string I need. I want to create a delve link of the user profile to be opened at a new browser tab. I have all working except the string rebuild of the email. Side note: I have used the replace operator to solve my problem (not mentioned and shown here!) But, I want to learn more and like to know, how to use the split operator and access each operand of the array individually. Somebody knowing it and can explain? Many thanks for teaching me in advance. Cheers JKSolved14KViews0likes2Commentsarray limitations?
Are there limitations to array sizes? I'm trying to get the line count of very large .txt files ( so far the largest file is 782MB) and also look for duplicates. The script works with small files as a test but when I try to run it against a larger file it doesn't finish and doesn't error. I'm monitoring CPU & memory and powershell_ise.exe where I am running it, is using 25% CPU and a memory working set of 880,568. Overall CPU on the VM is running around 27% and memory 50%, so it isn't topping out physical resources. The script does a few arrays to capture folders & subfolders and check subfolder names and then does counts of the .txt files found in the subfolders. This is a snippet of the section in question. ForEach ($sCARDHIST in $aCARDHISTFILES) { $sCARDHIST1 = $sCARDHIST.FullName ### get line counts in txt ### $sCARDHISTLINES = (Get-Content $sCARDHIST1).length ### Look for duplicates in file ### $aDUPS = Get-Content $sCARDHIST1 | group-Object | Where-Object {$_.Count -gt 1} | Select -ExpandProperty Name If ($aDUPS.count -gt 0 ) { echo "Duplicates found in $sCARDHIST1" >>$sFLAGFILE Write-Host "" Write-Host "=================================================" Write-Host "duplicate records found in $sCARDHIST1" Write-Host "=================================================" ForEach ($sDUP in $aDUPS) { FuncLogWrite "$sDUP" Write-Host "$sDUP" } } } Does anyone have information on array limitations or is there a better way in powershell to look for duplicates and line counts?5.2KViews0likes2CommentsArray Formulas Syntax - Matrix Calculations
Hi All, I am trying to simplify the equation below to a single-cell formula, where a, b, c are constants, and d and T are independent variables I want to take as input (i.e. d is for density and T is for temperature). The problem is I can not specify the T and d vectors, I must write them down in separate cells. What I would like, is to find a syntax to specify them in a formula, something of the like (F2^2;F2;1) and (G2^2;G2;1), in order to use with MMULT function. Is there a way to do it? Many thanks!!808Views0likes0Comments