Select Nearest Row and Quick Edit

I know there have been a few posts about this, and before I posted my own question, I looked at all of them (I think.) 

I'm trying to create an action that will select the nearest site to the currently selected row and enable quick edit.

Can anyone weigh in on whether I am close at all with this expression? It leads me to a blank screen that the emulator is just calling "&quickedit=true".

Again, apologies for asking a question that's been asked in different forms before. 

My table is called realm2, the key is "AssetNumber" and "LatLong" is...lat, long.

Thanks for taking a look!

LINKTOROW(
ANY(
SELECT(
realm2[AssetNumber],
AND(
IN([LatLong],
ORDERBY(
FILTER("realm2",
AND(
[AssetNumber] <> [_THISROW].[AssetNumber],
NOT(IN([AssetNumber], LIST([_THISROW].[AssetNumber]))),
ISNOTBLANK([LatLong])
)
),
DISTANCE([LatLong], [_THISROW].[LatLong])
)
),
ISNOTBLANK([LatLong])
)
)
),
"&quickedit=true"
)

Solved Solved
0 8 202
1 ACCEPTED SOLUTION

This should work:

CONCATENATE(
  LINKTOROW(
    INDEX(
      ORDERBY(
        FILTER(
          "realm2",
          AND(
            ISNOTBLANK([LatLong]),
            [_THISROW]<>[AssetNumber]
          )
        ),
        DISTANCE([LatLong], [_THISROW].[LatLong])
      ),
      1
    )
  ),
  "&quickedit=true"
)

And this may be a better option (withouth AND):

CONCATENATE(
  LINKTOROW(
    INDEX(
      ORDERBY(
        FILTER(
          "realm2",
          ISNOTBLANK([LatLong])
        ),
        DISTANCE([LatLong], [_THISROW].[LatLong])
      ),
      2
    )
  ),
  "&quickedit=true"
)

 

View solution in original post

8 REPLIES 8


@Ryan_Wagner wrote:

It leads me to a blank screen that the emulator is just calling "&quickedit=true".


Per the LINKTOROW function's syntax, the parameter for which you're using "&quickedit=true" should be the name of a view in the app.

Yeah, I realized that after I wrote it...Any advice on how to accomplish what I'm after?

For the moment, just to stop my eyes bleeding;

LINKTOROW(
  ANY(
    SELECT(
      realm2[AssetNumber],
      AND(
        IN(
          [LatLong],
          ORDERBY(
            FILTER("realm2",
              AND(
                [AssetNumber] <> [_THISROW].[AssetNumber],
                NOT(IN([AssetNumber], LIST([_THISROW].[AssetNumber]))),
                ISNOTBLANK([LatLong])
              )
            ),
            DISTANCE([LatLong], [_THISROW].[LatLong])
          )
        ),
        ISNOTBLANK([LatLong])
      )
    )
  ),
  "&quickedit=true"
)

Yeah, I understand that. Sorry.

This should work:

CONCATENATE(
  LINKTOROW(
    INDEX(
      ORDERBY(
        FILTER(
          "realm2",
          AND(
            ISNOTBLANK([LatLong]),
            [_THISROW]<>[AssetNumber]
          )
        ),
        DISTANCE([LatLong], [_THISROW].[LatLong])
      ),
      1
    )
  ),
  "&quickedit=true"
)

And this may be a better option (withouth AND):

CONCATENATE(
  LINKTOROW(
    INDEX(
      ORDERBY(
        FILTER(
          "realm2",
          ISNOTBLANK([LatLong])
        ),
        DISTANCE([LatLong], [_THISROW].[LatLong])
      ),
      2
    )
  ),
  "&quickedit=true"
)

 

Thanks a lot for working through that. I'm getting the "LINKTOROW must have two or three text arguments" warning. I don't know what else to add to that expression...

In the LinkToRow you have to add the view you want to open, which I expect to be a Detail View. Add the name of it here:

SkrOYC_0-1685123133793.png

That worked perfectly! Thanks!

Top Labels in this Space